#include <stdio.h>    
int head[105], people[105];    
    
    
void swap(int *c, int i, int j) {    
   int temp = *(c + i);    
   *(c + i) = *(c + j);    
   *(c + j) = temp;    
}    
    
int main() {    
   int n, m, cnt = 0, score = 0;    
  if (scanf("%d%d", &n, &m));    
    for (int i = 0; i < n; i++)    
     if (scanf("%d", &head[i]));    
    for (int i = 0; i < m; i++)    
     if (scanf("%d", &people[i]));    
  for (int i = 0; i < n; i++)    
     for (int j = 0; j < n; j++)    
         if (head[i] < head[j])    
              swap(head, i, j);    
  for (int i = 0; i < m; i++)    
     for (int j = 0; j < m; j++)    
         if (people[i] < people[j])    
              swap(people, i, j);    
    for (int i = 0; i < n; i++) {    
       if (cnt == m) {    
            printf("bit is doomed!\n");    
            return 0;    
      }    
      if (people[cnt++] >= head[i])    
           score += people[cnt - 1];    
      else    
           i--;    
   }    
  printf("%d\n", score);    
 return 0;    
}  